package com.atqh.srrt.chicken.controller.BlogController;


import com.atqh.srrt.chicken.service.CategoryService;
import com.atqh.srrt.chicken.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("categorys")
@CrossOrigin
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    // /categorys
    @GetMapping("/list")
    public Result categories(){
        return categoryService.findAll();
    }


}
